package com.eveinfo.api.mail;

import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import com.eveinfo.api.AbstractApiParser;
import com.eveinfo.api.ApiAuth;
import com.eveinfo.api.ApiException;
import com.eveinfo.api.NoCacheFoundExecption;

public class MailParser extends AbstractApiParser<MailResponse,MailHandler> {
	protected static final String MAIL_URL = "/MailMessages.xml.aspx";

	private static MailParser instance;
	
	public static MailParser getInstance(){
		if(instance == null){
			instance = new MailParser();
		}
		return instance;
	}
	
	private MailParser() {
		super(MailResponse.class, 1, MAIL_URL);
	}

	public MailResponse getAccountBalance(ApiAuth auth) throws IOException, SAXException, ParserConfigurationException,
			ApiException, NoCacheFoundExecption {
		MailHandler handler = new MailHandler();
		return getResponse(auth, Path.CHARACTER, handler);
	}

}